﻿using System;

namespace nHydrate.EFCore.DataAccess
{
	/// <summary>
	/// The interface for a context object
	/// </summary>
	public partial interface IContext
	{
		/// <summary>
		/// Determines the key of the model that created this library.
		/// </summary>
		string ModelKey { get; }

		/// <summary>
		/// Determines the version of the model that created this library.
		/// </summary>
		string Version { get; }

		/// <summary>
		/// Determines if the API matches the database connection
		/// </summary>
		bool IsValidConnection();

		/// <summary>
		/// Determines if the API matches the database connection
		/// </summary>
		/// <param name="checkVersion">Determines if the check also includes the exact version of the model</param>
		bool IsValidConnection(bool checkVersion);

		/// <summary>
		/// Given a field enumeration value, returns an entity enumeration value designating the source entity of the field
		/// </summary>
		Enum GetEntityFromField(Enum field);

		/// <summary>
		/// Given an entity enumeration value, returns a metadata object for the entity
		/// </summary>
		/// <param name="entity"></param>
		/// <returns></returns>
		object GetMetaData(Enum entity);

		/// <summary>
		/// Given a field enumeration value, returns the system type of the associated property
		/// </summary>
		/// <param name="field"></param>
		/// <returns></returns>
		System.Type GetFieldType(Enum field);

	}
}
